<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr =["top250","comingsoon","inTheaters"]
        function getData(url){
            return new Promise((resolve,reject)=>{
                setTimeout(()=>{
                    resolve(url)
                },1000)
            })
        }
        (async ()=>{
            /* 异步循环 */
            /* arr.forEach(async item=>{
                var res = await getData(item)
                console.log(res);
            }) */
            /* 同步循环 */
            for(let value of arr){
                let res = await getData(value);
                console.log(res);
            }
        })()
    </script>
</body>
</html>